﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TestOnlineProject.Models.DataAccess;
using TestOnlineProject.Models.Entities;

namespace TestOnlineProject.Models.BusinessLogic
{
    public class AnswerBLO
    {
        AnswerDAO answerDAO = new AnswerDAO();

        public int Add(Answer answer)
        {
            int result = answerDAO.Insert(answer);
            return result;
        }

        public Answer Find(int answerId)
        {
            try
            {
                var answer = answerDAO.SelectByAnswerId(answerId);
                return answer;
            }
            catch (Exception)
            {
                return null;
            }
        }
    }
}